// 指标考核>>>>创建考核
import request from '@/router/axios'
// 查询考核列表
export function examineList(obj, type) {
  return request({
    url: `/appr-event/routineAssessKpi/page/${type}`,
    method: 'get',
    params: obj
  })
}
// 查询默认启动的考核
export function defaultList(obj) {
  return request({
    url: '/appr-event/routineAssess/default',
    method: 'get',
    params: obj
  })
}
// 新增考核
export function addExamin(obj) {
  return request({
    url: '/appr-event/routineAssessKpi',
    method: 'post',
    data: obj
  })
}

// 编辑考核
export function editExamin(obj) {
  return request({
    url: '/appr-event/routineAssessKpi',
    method: 'put',
    data: obj
  })
}

// 拟定推送
export function proposedPush(ids, otherUserId,deptId) {
  return request({
    url: `/appr-event/routineAssessKpi/process/push/${ids}${otherUserId ? '/' + otherUserId : ''}${deptId ? '/' + deptId : ''}`,
    method: 'put',
  })
}

// 拟定推送本人
export function pushbr(ids) {
  return request({
    url: `/appr-event/routineAssessKpi/process/pushbr/${ids}`,
    method: 'put',
  })
}

// 删除考核
export function deleteExamin(ids) {
  return request({
    url: `/appr-event/routineAssessKpi/delete/${ids}`,
    method: 'get',
  })
}

// 通过id查询详情
export function examinDetail(id) {
  return request({
    url: `/appr-event/routineAssess/${id}`,
    method: 'get',
  })
}

// 通过id查询详情
export function noKhzqList(id) {
  return request({
    url: `/appr-event/routineAssess/getByIdno/${id}`,
    method: 'get',
  })
}

// 获取考核周期列表
export function examinPeriodList() {
  return request({
    url: `/appr-event/routineAssess/periodList`,
    method: 'get',
  })
}
// 查询数据详情
export function personDetail(id) {
  return request({
    url: `/appr-event/routineAssessKpi/${id}`,
    method: 'get',
  })
}
// news 2022/4/8
//模板下拉选列表
export function getMbnameSelect() {
  return request({
    url: '/appr-event/rckhkpitemplatemain/getTemplateList',
    method: 'get'
  })
}
// 查询选中要复用的具体指标
export function repeatIndexDetail(id) {
  return request({
    url: `/appr-event/routineAssessKpi/${id}`,
    method: 'get',
  })
}
// 查询指标评审和填报审核页面列表
export function indexExaminList(obj, queryType) {
  return request({
    url: `/appr-event/routineAssessKpi/kpi/audit/page/${queryType}`,
    method: 'get',
    params: obj
  })
}

//by mingyue
export function zltest(obj) {
  return request({
    url: '/appr-event/routineAssessKpi/checkParticipant',
    method: 'get',
    params: obj
  })
}

export function taskList(obj, type) {
  return request({
    url: `/appr-event/rckhKpiTaskList/page/${type}`,
    method: 'get',
    params: obj
  })
}

//指标跟踪导出()
export function targetTrackExportExcel(query) {
  return request({
    url: `/appr-event/routineAssessKpi/process/exportExcel`,
    method: 'post',
    data: query,
    responseType: 'blob'
  })
}

//结果评审导出
export function scoreExportExcel(query) {
  return request({
    url: `/appr-event/routineAssessKpi/scorereslut/exportExcel  `,
    method: 'post',
    data: query,
    responseType: 'blob'
  })
}
//结果评审导出
export function exportExcelZb(query) {
  return request({
    url: `/appr-event/routineAssessKpi/scorereslut/exportExcelZb  `,
    method: 'post',
    data: query,
    responseType: 'blob'
  })
}

// 机构列表展示
export function showJgTree(query) {
  return request({
    url: '/appr-event/routineAssessKpi/getKpiTree',
    method: 'get',
    params: query
  })
}
// 机构列表展示
export function getKpiTreeAll(query) {
  return request({
    url: '/appr-event/routineAssessKpi/getKpiTreeAll',
    method: 'get',
    params: query
  })
}
// 机构列表展示
export function getKpiTreeAllNew(query) {
  return request({
    url: '/appr-event/routineAssessKpi/getKpiTreeAllNew',
    method: 'get',
    params: query
  })
}
export function getFormula1() {
  return request({
    url: '/admin/sysformula/page?current=1&size=1000&gsMc=&gsType=考核算法&jjDeptId=0',
    method: 'get'
  })
}

export function getFormula2() {
  return request({
    url: '/admin/sysformula/page?current=1&size=1000&gsMc=&gsType=考核汇总&jjDeptId=0',
    method: 'get'
  })
}

// 发约人组织结构
export function fetchUserList(query) {
  return request({
    url: '/appr-event/rckhsjkhdx/getUserList',
    method: 'get',
    params: query
  })
}

// 验证指标是否重复
export function checkitem(assessParticipantId, normIds) {
  return request({
    url: `/appr-event/routineAssessKpiDetail/checkitem/${assessParticipantId}/${normIds}`,
    method: 'get',
  })
}

